package com.fr.base.print;

import java.awt.Graphics;
import java.awt.Graphics2D;
import java.awt.Image;
import java.awt.print.PageFormat;
import java.awt.print.Printable;
import java.awt.print.PrinterException;

public class ImagePrintable
  implements Printable
{
  private Image image;

  public ImagePrintable(Image paramImage)
  {
    this.image = paramImage;
  }

  public int print(Graphics paramGraphics, PageFormat paramPageFormat, int paramInt)
    throws PrinterException
  {
    Graphics2D localGraphics2D = (Graphics2D)paramGraphics.create();
    localGraphics2D.translate(paramPageFormat.getImageableX(), paramPageFormat.getImageableY());
    paramGraphics.drawImage(this.image, 0, 0, null);
    return 0;
  }
}